<?php

namespace app\model;

class User extends BaseModel
{
    /**
     * 关联角色
     */
    public function role(){
        return $this->hasOneThrough(Role::class, UserRoleRelation::class, 'user_id', 'id', 'id', 'role_id');
    }
}